import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class validateinput {

	/**
	 * @param args
	 * @throws NumberFormatException
	 * @throws IOException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		float a, b, c = 0;

		BufferedReader object = new BufferedReader(new InputStreamReader(
				System.in));

		while (true) {
			try {
				System.out.println("enter first side a");
				a = Float.parseFloat(object.readLine());

				if (a <= 0) {
					System.out.println("enter positive non zero number");
				} else {
					System.out.println("first side is " + a);
					break;
				}
			} catch (Exception e) {
				System.out.println("enter number only");
			}
		}

		while (true) {
			try {
				System.out.println("enter second side b");
				b = Float.parseFloat(object.readLine());

				if (b <= 0) {
					System.out.println("enter positive non zero number");
				} else {
					System.out.println("second side is " + b);
					break;
				}
			} catch (Exception e) {
				System.out.println("enter number only");
			}
		}

		while (true) {
			try {
				System.out.println("enter third side c");
				c = Float.parseFloat(object.readLine());

				if (c <= 0) {
					System.out.println("enter positive non zero number");
				}

				else {
					System.out.println("third side is " + c);
					break;
				}
			} catch (Exception e) {
				System.out.println("enter number only");
			}
		}
		// added '=' to check the valid sides of a triangle
		if ((a + b) <= c || (b + c) <= a || (a + c) <= b) {
			System.out
					.println("these are not valid sides of a triangle..please enter correct sides");

			while (true) {
				try {
					System.out.println("enter first side a");
					a = Float.parseFloat(object.readLine());

					if (a <= 0) {
						System.out.println("enter positive non zero number");
					} else {
						System.out.println("first side is " + a);
						break;
					}
				} catch (Exception e) {
					System.out.println("enter number only");
				}
			}

			while (true) {
				try {
					System.out.println("enter second side b");
					b = Float.parseFloat(object.readLine());

					if (b <= 0) {
						System.out.println("enter positive non zero number");
					} else {
						System.out.println("second side is " + b);
						break;
					}
				} catch (Exception e) {
					System.out.println("enter number only");
				}
			}
			while (true) {
				try {
					System.out.println("enter third side c");
					c = Float.parseFloat(object.readLine());

					if (c <= 0) {
						System.out.println("enter positive non zero number");

					} else {
						System.out.println("third side is " + c);
						break;
					}
				} catch (Exception e) {
					System.out.println("enter number only");
				}
			}

		}// end of if checking valid sides

		if ((a == b) && (b == c) && (a == c)) {
			System.out.println("triangle is equilateral");
		}

		if (a == b && b != c || b == c && a != c || a == c && a != b) {
			System.out.println("triangle is isoscales");

		}

		if (a != b && b != c && a != c)
		{
			
			if ((a * a + b * b == c * c) || (b * b + c * c == a * a)|| (a * a + c * c == b * b))
			{
				System.out.println("triangle is right angled");
			} 
			else
			{
				System.out.println("triangle is scalene");
			}

		}

	}

}
